This replication repository contains three main folders, the contents of which are described below:

1. data
2. code
3. results

All contents of this replication repository should be maintained within their current directory structure in order to allow for the R scripts to properly access necessary files. 

The R version employed in the creation of this replication repository was R version 3.6.3 (2020-02-29, "Holding the Windsock"). The R packages used are 'dplyr' (1.0.2), 'ggplot2' (3.3.0), 'gridExtra' (2.3), 'Hmisc' (4.4.0), 'lmtest' (0.9.37), 'sandwich' (2.5.1), 'survey' (4.0), 'texreg' (1.37.5), and 'xgboost' (1.0.0.2).

(1) The 'data' folder contains 3 primary data files and 4 additional subfolders. 

The 3 primary data files ('respdata_svy1.csv', 'respdata_svy2.csv', and 'conjdata_svy2.csv') contain the survey data that were collected and analyzed in the study, where respdata_svy1 pertains to the respondent-level 2015 survey data, respdata_svy2 pertains to the respondent-level 2019 survey data, and conjdata_svy2 pertains to the 2019 survey conjoint data at the level of respondent-profile. 

The 'codebooks' subfolder contains codebooks for each of the primary data files. The 'weights' subfolder contains csv files storing the survey weights that are used in the study analysis. The 'random_folds_cv' subfolder contains csv files storing randomly generated cross-validation folds used in several analyses. The 'google_trends' subfolder contains csv files storing the Google Trends data used for one of the appendix figures.

(2) The 'code' folder contains 3 subfolders. 

The 'analysis' subfolder contains 59 R scripts, sequentially numbered, used for producing all analyses, figures, and tables in the main study text and appendix. The 'helper_functions' subfolder contains additional scripts and functions that are sourced by and support the analysis scripts. The 'weight_creation' subfolder contains the scripts used for creating the survey weights.

(3) The 'results' folder contains 2 subfolders.

The 'figures' subfolder contains all figures produced in the analysis and included in the main study text and appendix. The 'objects' subfolder contains results of the analysis and other intermediary objects that are produced and then sourced by the various scripts to create the figures.


(*) Approximate runtimes for the R scripts on a standard laptop (Intel Core i7-8750H @ 2.20 GHz, 16.00 GB RAM, Windows 10 64-bit) can be found below.

The runtime for each script is less than 10 seconds, with the exception of the following 8 scripts:

code/analysis/2_2_model_CV.R: ~1 hour
code/analysis/2_3_train_final_models.R: ~1 minute
code/analysis/2_4_package_preds.R: ~1 minute
code/analysis/2_5_package_preds_bootstrap_it.R: ~4 hours
code/analysis/2_6_package_preds_bootstrap_sp.R: ~4 hours
code/analysis/4_24_eval_model_CV.R: ~2 minutes
code/analysis/4_27_figA21.R: ~1 minute
code/analysis/4_28_figA22.R: ~1 minute
